<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
    <script src="https://www.layuicdn.com/layui/layui.js"></script>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
<form class="layui-form" th:each="a:${ga}">
    <input type="hidden" th:name="roomid" th:value="${a.roomid}">
                <div class="layui-form-item">
                    <label class="layui-form-label">楼号</label>
                    <div class="layui-input-block">
                        <input type="text" name="buildingname" th:value="${a.buildingname}"  class="layui-input" disabled="disabled">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">楼层号</label>
                    <div class="layui-input-inline">
                        <input type="tel" name="loucengno" th:value="${a.loucengno}"  class="layui-input" disabled="disabled">
                    </div>
                </div>



    <div class="layui-form-item">
        <label class="layui-form-label">客户姓名</label>
        <div class="layui-input-block">
            <select th:name="clientmessageid" lay-filter="aihao">
                <option th:each="c:${gc}" th:value="${c.clientmessageid}" th:text="${c.clientname}" th:selected="${a.clientmessageid == c.clientmessageid }" ></option>
            </select>
        </div>
    </div>

        <div style="margin-left: 210px">
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="tijiao">提交</button>
        </div>


</form>

<script type="text/javascript">
    layui.use(['form', 'layer', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,$=layui.jquery;
        //监听提交
        form.on('submit(tijiao)', function(data){
            //data.field表单所有信息
            $.post("addBtnRoom",data.field,function(result)
                {
                    layer.msg(result.msg, {
                        icon: 1,
                        time: 1000 //2秒关闭（如果不配置，默认是3秒）
                    }, function(){
                        //刷新父页面
                        parent.window.location.reload();
                        //window.parent.location.replace(location.href)
                    });
                }
            );
            return false;
        });
    });
</script>


</body>
</html>